<strong class="header">Database table creation</strong><br />
<?php
$user = $_POST['user'];
$pass = md5($_POST['pass']);
$title = $_POST['sitename'];
$subtitle = $_POST['subtitle'];

$error1 = "Table creation failed.  User and pass may not be right or the table might already exist";
$sql1 = 'CREATE TABLE `'.$db_prefix.'main` ('
		. ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, '
		. ' `option` VARCHAR(50) NOT NULL, '
		. ' `value` VARCHAR(100) NOT NULL'
		. ' )'
		. ' ENGINE = myisam;';
$sql2 = 'CREATE TABLE `'.$db_prefix.'posts` ('
        . ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, '
        . ' `title` VARCHAR(100) NOT NULL, '
        . ' `author` VARCHAR(20) NOT NULL, '
        . ' `date` VARCHAR(20) NOT NULL, '
        . ' `type` VARCHAR(10) NOT NULL, '
        . ' `text` LONGTEXT NOT NULL'
        . ' )'
        . ' ENGINE = myisam;';
echo "<strong>Creating main table....</strong>";
$result = mysql_query($sql1) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n");

echo "\n<br /><br /><strong>Creating posts table....</strong>";
$result = mysql_query($sql2) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n");

echo "<br /><br /><strong>Inserting main options....</strong>";
$query = "INSERT INTO `".$db_prefix."main` (`option`, `value`) VALUES ('title', '$title')";
mysql_query($query) or die ("FAILED - $error1");

$query = "INSERT INTO ".$db_prefix."main (`option`, `value`) VALUES ('subtitle', '$subtitle')";
mysql_query($query) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n".mysql_error());

$query = "INSERT INTO ".$db_prefix."main (`option`, `value`) VALUES ('skin', 'fresh')";
mysql_query($query) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n");

$query = "INSERT INTO ".$db_prefix."main (`option`, `value`) VALUES ('postlimit', '10')";
mysql_query($query) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n");

$query = "INSERT INTO ".$db_prefix."main (`option`, `value`) VALUES ('user', '$user')";
mysql_query($query) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n");

$query = "INSERT INTO ".$db_prefix."main (`option`, `value`) VALUES ('pass', '$pass')";
mysql_query($query) or die ("<abbr title=\"$error1\">FAILED</abbr><br />\n");

echo "<br />OK!<br />\n";
echo "All SQL setup complete\n";
/*
[23:59:01] GreyFox: New Pokeyman that evolves into Snorlax
[23:59:06] GreyFox: Who ows
[23:59:08] GreyFox: owns
[23:59:15] Tallain:  Munchlax?
[23:59:17] Tallain:  WTF
[23:59:21] GreyFox: Yeah
[23:59:29] GreyFox: The English name Munchlax[3] is a portmanteau of the English words munch and lax or relax. To munch is to bite or chew noisily. The word lax means careless, casual and easygoing.
[23:59:45] GreyFox: Careless, noisy chewing
[23:59:51] Tallain:  EASY GOING NOISY CHEW
[23:59:51] GreyFox: This is what we've got now?
*/
?>
<div class="next"><a href="?install=ok&step=done">Next</a></div>